package com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.view;

import android.view.View;
import android.webkit.WebView;
import android.widget.ProgressBar;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.R;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.base.BaseActivity;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.contract.IAboutDeskMediaContract;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.persenter.AboutDeskMediaPersenter;

/**
 * Created by Administrator on 2018/8/14.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class AboutDeskMediaActivity  extends BaseActivity implements IAboutDeskMediaContract.IAboutDeskMediaView {

    private ProgressBar my_progress;
    private WebView webview_01;
    private AboutDeskMediaPersenter mAboutDeskMediaPersenter = new AboutDeskMediaPersenter(this);

    @Override
    protected void userAgreedPermissions() {

    }

    @Override
    protected View AddLayoutView() {
        View view = View.inflate(this, R.layout.activity_about_desk_media,null);
        my_progress = view.findViewById(R.id.activity_about_desk_media_progress);
        webview_01 = view.findViewById(R.id.activity_about_desk_media_webview_01);
        return view;
    }

    @Override
    protected void initChildViewDate() {
        mAboutDeskMediaPersenter.initTitle();
        mAboutDeskMediaPersenter.initWebview(webview_01);
    }

    @Override
    protected void onClickedTvRight() {

    }

    @Override
    protected void onClickedIvRight() {

    }

    @Override
    protected void onClickedIvLeft() {
            finish();
    }

    @Override
    public void showTitle() {
        showTilteBg();
        showTitleContent();
        showTileIvLeft();
        //设备管理(6)
        setTitleContent("关于席媒", 0xffffffff);
        setIvLeftIcon(R.mipmap.left_white_return);
        setTitleContentSize(16);
    }

    @Override
    protected void onResume() {
        super.onResume();
        mAboutDeskMediaPersenter.webviewonResume(webview_01);
    }

    @Override
    protected void onPause() {
        super.onPause();
        mAboutDeskMediaPersenter.webviewonPause(webview_01);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mAboutDeskMediaPersenter.webviewonDestroy(webview_01);
    }

    @Override
    public void showProgressBar() {
        my_progress.setVisibility(View.VISIBLE);
    }

    @Override
    public void hidenProgressBar() {
        my_progress.setVisibility(View.GONE);
    }

    @Override
    public void setMyProgress(int progress) {
        my_progress.setProgress(progress);
    }
}
